source config.sh

if [ "$1" = "" ]; then
	echo please input DNS
	exit
fi
DNS=$1
User=ubuntu
Path=/home/ubuntu/MahJong/*.out
scp -oStrictHostKeyChecking=no -i $KeyPairPEM $User@$DNS:$Path $DownloadFolder/

FILENAME=$DownloadFolder/*.out
FILESIZE=$(wc -c < $FILENAME)

if [ "$FILESIZE" = "" ]; then
	FILESIZE=0
fi 
if [ $FILESIZE -eq 0 ]; then
	echo "$FILENAME is empty, and will be deleted"
	rm $FILENAME
	
fi 